package com.rizzo.android.domain;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import java.io.Serializable;

@DatabaseTable(tableName = ErrorData.TABLE_NAME)
public class ErrorData implements Serializable {

	public static final String TABLE_NAME = "error_data";
	public static final String ID_FIELD = "_id";
	public static final String USER_FIELD = "user";
	public static final String COUNT_FIELD = "count";
	public static final String ERROR_FK_FIELD = "error_fk";
	public static final String[] AVAILABLE_FIELDS = {ID_FIELD, USER_FIELD, COUNT_FIELD, ERROR_FK_FIELD};

	@DatabaseField(id = true, columnName = ID_FIELD, generatedId = true)
	private long id;

	@DatabaseField(canBeNull = false, columnName = USER_FIELD)
	private String user;

	@DatabaseField(canBeNull = false, columnName = COUNT_FIELD)
	private double count;

	@DatabaseField(canBeNull = false, foreign = true, columnName = ERROR_FK_FIELD)
	private Error error;

	public ErrorData() {
	}

	public ErrorData(String user, double count) {
		this.count = count;
		this.user = user;
	}

	public double getCount() {
		return count;
	}

	public void setCount(double count) {
		this.count = count;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}
}
